package com.cdtye.itps.cms.controller.origindata;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.cdtye.common.webcore.web.AjaxJson;
import com.cdtye.itps.cms.dao.origindata.vo.JcjcDetectC4JobVo;
import com.cdtye.itps.cms.service.dept.SysDeptService;
import com.cdtye.itps.cms.service.origindata.JcjcDetectC4JobService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.Map;

import static com.cdtye.common.webcore.web.AjaxJson.success;

@Api(tags="4c原始数据接口")
@Controller
@ResponseBody
@RequestMapping("/detect4cJob")
public class JcjcDetectC4JobController {
    @Autowired
    private JcjcDetectC4JobService jcjcDetectC4JobService;
    @Autowired
    private SysDeptService sysDeptService;

    @ApiOperation(value = "4c原始数据分页查询")
    @PostMapping(value = "/listPage")
    public AjaxJson<IPage<Map<String,Object>>> listPage(@RequestBody JcjcDetectC4JobVo vo){
        vo.setUnitDeptCode(sysDeptService.getUnitDeptCodeByLoginUser(vo.getUnitDeptCode()));
        return success(jcjcDetectC4JobService.listPage(vo));
    }
}
